Skip to content

Use PGO when building binaries#2138

Merged
cffls merged 3 commits intodevelopfrom
pgo
Mar 12, 2026
Merged

Use PGO when building binaries#2138
cffls merged 3 commits intodevelopfrom
pgo

Conversation

@cffls
Copy link
Contributor

@cffls cffls commented Mar 11, 2026

Description

The pprof file was a merge from pprof taken from a production block producer and a sentry. This profile allows the go compiler to make more informed optimization decisions during compilation. For more info, see: https://go.dev/doc/pgo

The pprof file was a merge from pprof taken from a production block producer and a sentry.
This profile allows the go compiler to make more informed optimization decisions during compilation.
For more info, see: https://go.dev/doc/pgo
@claude
Copy link

claude bot commented Mar 11, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — straightforward addition of the PGO flag to the build target.

Extended reasoning...

Overview

This PR adds Profile-Guided Optimization (PGO) to the make bor build target by including a -pgo=prod.pprof flag and committing a merged production pprof profile. The change touches two files: a one-line modification to the Makefile and the addition of the binary prod.pprof profile.

Security risks

No security concerns. The change only affects compiler optimization behavior via a standard Go feature (-pgo). The pprof file is a CPU profile used by the compiler — it contains no secrets or executable code.

Level of scrutiny

This is a low-risk, mechanical change. PGO is a well-documented Go compiler feature (available since Go 1.21) that uses profiling data to guide optimization decisions. The worst-case outcome is that the profile provides no benefit; it cannot introduce correctness issues. The inline bug comment about the goreleaser config not including the flag is a valid enhancement suggestion but does not affect the correctness of this change.

Other factors

The PR is small and self-contained with clear intent described in the PR description. The nit about .goreleaser.yml missing the PGO flag for official release builds is already raised as an inline comment and is worth the author considering, but it does not block this change.

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.54%. Comparing base (5eb6b6c) to head (6212020).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2138      +/-   ##
===========================================
+ Coverage    51.50%   51.54%   +0.04%     
===========================================
  Files          882      882              
  Lines       154081   154081              
===========================================
+ Hits         79352    79420      +68     
+ Misses       69552    69492      -60     
+ Partials      5177     5169       -8     

see 19 files with indirect coverage changes
see 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@lucca30 lucca30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sonarqubecloud
Copy link

@cffls cffls merged commit 256bc94 into develop Mar 12, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants